<template>
  <div>
    <van-nav-bar
      title="重置密码"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <!-- 密码 -->
    <van-cell-group>
      <van-field v-model="username" placeholder="用户名" />
      <van-field v-model="passwordu" placeholder="旧密码" />
      <van-field v-model="passwordx" placeholder="新密码" />
    </van-cell-group>
    <div class="dox">
      <van-button type="info" @click="dianji">信息按钮</van-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      onClickLeft() {
        // Toast("返回");
        console.log(234567);
      },
      username: "", //用户名
      passwordu: "", //旧密码
      passwordx: "", //新密码
      //旧密码
      value: "",
      //用户名
      item: "",
      //新值
      xingzhi: "",
    };
  },
  created() {
    this.value = this.$route.params.id; //密码
    this.item = this.$route.params.tien; //用户名
    console.log(this.item);
  },
  methods: {
    dianji() {
      console.log(this.item);
      console.log(this.username);
      if (this.item != this.username) {
        //   this.username = this.item;
        this.$toast.fail("用户名输入错误");
        return;
      }
      if (this.value == this.passwordu) {
        this.value == this.passwordx;
        this.xingzhi = this.value;
      }
    },
  },
};
</script>

<style lang="less" scoped>
/deep/ .van-nav-bar {
  background-color: rgb(130, 130, 204);
  height: 50px;
  .van-nav-bar__title {
    color: azure;
  }
  .van-icon {
    color: azure;
  }
}
.van-field {
  height: 50px;
  margin-top: 10px;
  //   border-top: 1px solid #999;
}
.dox {
  width: 490px;
}
.van-button {
  margin: 10px;
  width: 100%;
  border-radius: 10px;
  height: 50px;
  background-color: brown;
}
</style>